# coding utf-8
from Software_Set_UI import Ui_MainWindow
from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout, QToolButton, QSizePolicy, QPushButton, \
    QGroupBox, QGridLayout
from PyQt5.QtGui import QIcon, QFont, QPixmap
from PyQt5.QtCore import QPoint, QRect, QSize, Qt  # , pyqtSignal
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5 import QtWidgets, QtCore
from PyQt5 import QtGui
# PySide2
# PyQt5
import sys
import os
from os import environ, listdir, makedirs, pathsep, startfile
# from PyQt5 import QtCore, QtGui, QtWidgets
import json

import xml.dom.minidom
print("----------------------")
class SoftwareWidget_Window(Ui_MainWindow, QMainWindow):
    def SoftwareWidget(self,text):

        self.New_Starter_Layout = QtWidgets.QGridLayout()
        self.New_Starter_Layout.setObjectName(text + "_New_Starter_Layout")
        self.Starter_variate_Layout = QtWidgets.QVBoxLayout()
        self.Starter_variate_Layout.setObjectName(text + "_Starter_variate_Layout")
        '''
        self.Variable_horizontal_Layout = QtWidgets.QHBoxLayout()
        self.Variable_horizontal_Layout.setSizeConstraint(QtWidgets.QLayout.SizeConstraint.SetMinAndMaxSize)
        self.Variable_horizontal_Layout.setObjectName("Variable_horizontal_Layout")
        self.Variable_lineEdit = QtWidgets.QLineEdit()
        self.Variable_lineEdit.setObjectName("Variable_lineEdit")
        self.Variable_horizontal_Layout.addWidget(self.Variable_lineEdit)
        self.Value_lineEdit = QtWidgets.QLineEdit()
        self.Value_lineEdit.setObjectName("Value_lineEdit")
        self.Variable_horizontal_Layout.addWidget(self.Value_lineEdit)
        self.Del_Variable_Button = QtWidgets.QPushButton()
        self.Del_Variable_Button.setMinimumSize(QtCore.QSize(25, 25))
        self.Del_Variable_Button.setMaximumSize(QtCore.QSize(25, 25))
        self.Del_Variable_Button.setObjectName("Del_Variable_Button")
        self.Variable_horizontal_Layout.addWidget(self.Del_Variable_Button)
        self.Starter_variate_Layout.addLayout(self.Variable_horizontal_Layout)'''


        self.New_Starter_Layout.addLayout(self.Starter_variate_Layout, 1, 1, 1, 1)
        spacerItem6 = QtWidgets.QSpacerItem(50, 20, QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum)
        self.New_Starter_Layout.addItem(spacerItem6, 0, 0, 1, 1)
        self.Starter_Basic_information_Layout = QtWidgets.QVBoxLayout()
        self.Starter_Basic_information_Layout.setObjectName(text + "_Starter_Basic_information_Layout")
        self.Software_horizontal_Layout = QtWidgets.QHBoxLayout()
        self.Software_horizontal_Layout.setObjectName("Software_horizontal_Layout")
        self.Software_Name_Button = QtWidgets.QPushButton(text)
        self.Software_Name_Button.setMinimumSize(QtCore.QSize(0, 30))
        self.Software_Name_Button.setObjectName(text)
        self.Software_horizontal_Layout.addWidget(self.Software_Name_Button)
        self.New_Variable_Button = QtWidgets.QPushButton()
        self.New_Variable_Button.setMinimumSize(QtCore.QSize(30, 30))
        self.New_Variable_Button.setMaximumSize(QtCore.QSize(30, 30))
        self.New_Variable_Button.setObjectName(text + "_New_Variable_Button")
        self.Software_horizontal_Layout.addWidget(self.New_Variable_Button)
        self.Software_Del_Button = QtWidgets.QPushButton()
        self.Software_Del_Button.setMinimumSize(QtCore.QSize(30, 30))
        self.Software_Del_Button.setMaximumSize(QtCore.QSize(30, 30))
        self.Software_Del_Button.setObjectName(text + "_Software_Del_Button")
        self.Software_horizontal_Layout.addWidget(self.Software_Del_Button)
        self.Software_horizontal_Layout.setStretch(0, 1)
        self.Starter_Basic_information_Layout.addLayout(self.Software_horizontal_Layout)
        self.Software_path_Layout = QtWidgets.QHBoxLayout()
        self.Software_path_Layout.setObjectName("Software_path_Layout")
        self.Software_Path_LineEdit = QtWidgets.QLineEdit()
        self.Software_Path_LineEdit.setObjectName(text + "_Software_Path_LineEdit")
        self.Software_path_Layout.addWidget(self.Software_Path_LineEdit)
        self.Software_Path_Button = QtWidgets.QPushButton()
        self.Software_Path_Button.setObjectName("Software_Path_Button")
        self.Software_path_Layout.addWidget(self.Software_Path_Button)
        self.Starter_Basic_information_Layout.addLayout(self.Software_path_Layout)
        self.New_Starter_Layout.addLayout(self.Starter_Basic_information_Layout, 0, 1, 1, 1)
        spacerItem7 = QtWidgets.QSpacerItem(50, 20, QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum)
        self.New_Starter_Layout.addItem(spacerItem7, 0, 2, 1, 1)
        